package com.kgis.fm.business.event
{
	import flash.events.Event;
	
	[Response(name="{RETURN_ID}", type="com.kgis.mvc.CommandCompletionEvent")]
	public class RequestFormEvent extends Event {
		public static const REQUEST_ID:String = "RequestFormEvent_Request";
		public static const RETURN_ID:String = "RequestFormEvent_Return";
		
		public static const TYPE_GET_FORM:int = 0;
		public static const TYPE_NEW_ENTITY:int = 1;
		public static const TYPE_GET_ENTITY_TEMPLATE_TYPE_GROUP:int = 2;
		public static const TYPE_GET_ENTITY_TEMPLATE_TYPE:int = 3;
		public static const TYPE_GET_ENTITY:int = 4;
		public static const TYPE_NEW_ENTITY_BY_METATYPE:int = 5;
		public static const TYPE_SAVE_ENTITY:int = 6;
		public static const TYPE_BATCH_SAVE_ENTITY:int = 7;
		public static const RELATION_ADD_ONE_TO_MANY_SAVE:int = 8;//1:N关系新增
		public static const RELATION_ADD_CODE_TO_PORT_SAVE:int = 9;//码号关联
		public static const RELATION_ADD_PORT_TO_PORT_SAVE:int = 10;//port关联  关联新增
		public static const TYPE_GET_ENTITYS:int = 11;
		public static const FIND_GENERAL_QUERY_PARAM:int = 12;//findGeneralQueryParamByAttributeTypeId
		public static const TYPE_GET_RELATIVE_ENTITYS:int = 13;
		public static const TYPE_GET_OPERATION_ENTITY_TEMPLATE_GROUP:int = 14;//findOperationEntityTemplateGroupsByEntityTypeId 
		public static const TYPE_GET_ENUM_MODELS:int = 15;
		public static const TYPE_GET_ENUM_MODELS_BY_CODE:int = 16;
		public static const TYPE_GET_ENUM_MODEL:int = 17;
		public static const TYPE_GET_ENUM_MODEL_BY_CODE:int = 18;
		public static const TYPE_COPY_ENTITY:int = 19;  //复制实体
		public static const TYPE_GRAFT_EVENT : int = 20;
		public static const TYPE_GRAFT_FILE_EVENT : int = 21;
		public static const TYPE_GRAFT_FILE_UPLOAD_RESULT : int = 22;
		public static const TYPE_GRAFT_DOFINISH : int = 23;
		
		
		
		private var _spec:Object;
		private var _actionType:int;
		public function RequestFormEvent(spec:Object,
										 actionType:int = TYPE_GET_FORM, type:String = null) {
			var typeId:String = type;
			if (type == null) {
				typeId = REQUEST_ID;
			}
			super(typeId);
			
			_spec = spec;
			_actionType = actionType;
		}
		
		public override function clone():Event {
			var event:RequestFormEvent = new RequestFormEvent(spec, actionType, type);
			return event;
		}
		
		public function get spec():Object {
			return _spec;
		}
		
		public function get actionType():int {
			return _actionType;
		}
	}
}